import Vue from "vue";
import Router from "vue-router";
import Layout from '@/layout/index'

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/login",
      name: "login",
      component: () => import('@/views/login/index'),
    },
    {
      path: "/",
      name: "dashboard",
      component: Layout,
      redirect: '/dashboard',
      children: [{
        path: 'dashboard',
        name: 'Dashboard',
        component: () => import('@/views/dashboard/index'),
        meta: { title: 'Dashboard' }
      }]
    },
    {
      path: "/",
      name: "article",
      component: Layout,
      redirect: '/article',
      children: [{
        path: 'article',
        name: 'article',
        component: () => import('@/views/article/index'),
        meta: { title: 'article' }
      }]
    },
    {
      path: "/",
      name: "article",
      component: Layout,
      redirect: '/article/create',
      children: [{
        path: 'article/create',
        name: 'article-create',
        component: () => import('@/views/article/form'),
        meta: { title: 'article-create' }
      }]
    },
    {
      path: "/",
      component: Layout,
      redirect: '/admin/edit',
      children: [{
        path: 'admin/edit',
        name: 'admin-edit',
        component: () => import('@/views/admin/index'),
        meta: { title: 'admin-edit' }
      }]
    },
    {
      path: "/",
      component: Layout,
      redirect: '/admin/repassword',
      children: [{
        path: 'admin/repassword',
        name: 'admin-repassword',
        component: () => import('@/views/admin/repassword'),
        meta: { title: 'admin-repassword' }
      }]
    },
  ]
});
